package com.straw.hat.springboot;

import org.springframework.boot.SpringApplication;

/**
 * @author jianshan@byai.com
 * @date 2020/12/14 3:26 PM
 * describe: 应用启动类和Spring容器启动类可以是不一样的
 */
public class MainClass {

    public static void main(String[] args) {
        //设置Spring容器启动类,标注@SpringBootApplication注解的类就OK
        SpringApplication springApplication  = new SpringApplication(StrawHatApplication.class);
        //自定实现自己的上下文容器(其实就是只要能继承ConfigurableApplicationContext的都是可以的,可以自定义实现一些方法)
        springApplication.setApplicationContextClass(StrawHatApplication.StrawHatApplicationContext.class);
        springApplication.run(args);
    }
}
